<?php
if(empty($row)){
	$extrow=$db->row_select_one("users","username='{$username}'");
	if(!empty($extrow) && !empty($extrow['salt'])){
		if(md5(md5($userpass).$extrow['salt'])==$extrow['userpass']){
			$row=$extrow;	//返回user的数据，继续登录的操作
			$new_row["userpass"]=$userpass_encrypt;
			$new_row["salt"]="";
			$db->row_update("users",$new_row,"id={$extrow['id']}");	//更新用户新密码
		}
	}
}
?>